package com.jtx.miaoah2.Common;

import java.util.Random;

/**
 * @author 季台星
 * @Date 2023 07 23 14 43
 */
public class RedisConstants {
    public static final String USER_INFO = "user_info_";
    public static final String SECKILL_INFO = "seckill_info_";
    public static final String SECKILL_LIST_INFO = "seckill_list_info_";

    public static final Random random = new Random();
    public static final String BLANK_USER = "blank_user";
    public static final String GOODS_STOCK = "goods_stock_";

    public static final String GOODS_TOKEN = "goods_token_";
    public static final String USER_TOKEN = "user_token_";

    //个人分布式锁
    public static final String USER_LOCK = "user_lock_";
    //全局分布式锁
    public static final String HOT_KEY = "hot_key";

    public static final String HOT_KEY_NAME = "hot_key_name_";
    public static final String GOODS_INFO = "goods_info";

    public static int getRandomNum(){
        //生成[0,index)区间内的随机数
        return random.nextInt(10);
    }
}
